package nl.hr.minor.mobilelife.j1213.jlr.findit;

import nl.hr.minor.mobilelife.j1213.jlr.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

/**
 * Splashscreen shown before FindIT is started. Displays for 3 seconds
 * @author Leon
 *
 */
public class SplashScreen extends Activity{

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.findit_splash);
		Thread timer = new Thread(){
			public void run(){
				try{
					int timer = 0;
					while (timer<3000){
						sleep(100);
						timer = timer +100;
					}
					startActivity(new Intent(SplashScreen.this, Menu.class));		
				}
				catch (InterruptedException e){
					e.printStackTrace();
				}
				finally{
					finish();
				}
			}
		};
		timer.start();
	}
}
